<template>
  <div class="displayProfile">
    <van-nav-bar :title="title" left-arrow @click-left="$router.go(-1)" />

    <van-cell v-if="+allUserInfo.user_status === 0">
      <template #title>
        <span class="custom-title">当前账户：</span>
        <van-tag type="success">
          {{ allUserInfo.user_status_desc || '正常' }}
        </van-tag>
      </template>
    </van-cell>

    <van-cell v-else value="联系近聘客服" is-link @click="toCustomerService">
      <template #title>
        <span class="custom-title">当前账户：</span>
        <van-tag type="danger">
          {{ allUserInfo.user_status_desc || '异常' }}
        </van-tag>
      </template>
    </van-cell>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
  name: 'displayProfile',
  data() {
    return {
      accontInfo: {
        desc: '3天限制',
        status: 1
      }
    }
  },
  computed: {
    ...mapGetters(['allUserInfo']),
    title() {
      return this.$route.query.title
    }
  },
  mounted() {
    console.log(this.allUserInfo)
  },
  methods: {
    toCustomerService() {
      this.$router.push({
        name: 'customer_service'
      })
      // let wxServiceUrl = 'https://work.weixin.qq.com/kfid/kfc7df01a980df46199';
      // let urlStr = encodeURI(wxServiceUrl)
      // try {
      //   plus.runtime.openURL(urlStr)
      // } catch (error) {
      //   window.location.href = wxServiceUrl
      // }
    }
  }
}
</script>

<style lang="scss" scoped>
.displayProfile {
  .custom-title {
    margin-right: 10px;
  }
}
</style>
